Skip to content

[Java Jersey3] fix missing dependency for java jersey3 withXml option - #24902

Merged
wing328 merged 6 commits into
OpenAPITools:masterfrom
MaikelBruin:feat/fix-java-jersey3-xml-dependency
Sep 10, 2026
Merged

wing328 merged 6 commits into
OpenAPITools:masterfrom
MaikelBruin:feat/fix-java-jersey3-xml-dependency

Conversation

@MaikelBruin

@MaikelBruin MaikelBruin commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Added missing dependency for jackson xml dataformat when selecting option withXml in the java generator in combination with the jersey3 library and jackson data processing.

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Fixes the missing jackson-dataformat-xml dependency in the Java Jersey3 generator when withXml is enabled, so generated POMs now resolve the XML module.

Bug Fixes

  • Adds the XML dataformat dependency to the Jersey3 pom.mustache template, using ${jackson-version} or ${jackson3-version} based on useJackson3.
  • Marks Jackson 3 XML model template compilation errors with a TODO.

Tests

  • Adds JavaJersey3WithXmlTest to verify generation succeeds and the POM references the XML artifacts.

Written for commit 50a8356. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@MaikelBruin

Copy link
Copy Markdown
Contributor Author

@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08) @KannaKim (2026/07)

@wing328

wing328 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Thanks for the PR.

I tested with java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml --library jersey3 --additional-properties withXml=true,useJackson3=true -o /tmp/xml3/ but the output fails to compile. Is that expected? Partial output below:

[ERROR]   symbol:   class JacksonXmlProperty
[ERROR]   location: class User
[ERROR] C:\Users\User\AppData\Local\Temp\xml\src\main\java\org\openapitools\client\model\User.java:[274,3] error: cannot find symbol
[ERROR]   symbol:   class JacksonXmlProperty
[ERROR]   location: class User
[ERROR] C:\Users\User\AppData\Local\Temp\xml\src\main\java\org\openapitools\client\model\User.java:[292,3] error: cannot find symbol
[ERROR]   symbol:   class JacksonXmlProperty
[ERROR]   location: class User

add docs and todo regarding jackson3 support
@MaikelBruin

Copy link
Copy Markdown
Contributor Author

Thanks for the PR.

I tested with java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml --library jersey3 --additional-properties withXml=true,useJackson3=true -o /tmp/xml3/ but the output fails to compile. Is that expected? Partial output below:

[ERROR]   symbol:   class JacksonXmlProperty
[ERROR]   location: class User
[ERROR] C:\Users\User\AppData\Local\Temp\xml\src\main\java\org\openapitools\client\model\User.java:[274,3] error: cannot find symbol
[ERROR]   symbol:   class JacksonXmlProperty
[ERROR]   location: class User
[ERROR] C:\Users\User\AppData\Local\Temp\xml\src\main\java\org\openapitools\client\model\User.java:[292,3] error: cannot find symbol
[ERROR]   symbol:   class JacksonXmlProperty
[ERROR]   location: class User

@wing328 thanks for the feedback. You are right. The cubic AI also found issues regarding jackson3 support in combination with xml. I extended the docs and added a TODO in the pom.mustache file explicitly stating that withXml option does not work in combination with useJackson3. So basically I just fixed the withXml option for jackson2 in this PR.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Not reviewed (too large): docs/generators/java.md (~504 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.

Re-trigger cubic

@wing328

wing328 commented Sep 10, 2026

Copy link
Copy Markdown
Member

please revert the change in docs/generators/java.md so as to fix https://github.com/OpenAPITools/openapi-generator/actions/runs/34332842605/job/102416313593?pr=24902

@MaikelBruin

Copy link
Copy Markdown
Contributor Author

please revert the change in docs/generators/java.md so as to fix https://github.com/OpenAPITools/openapi-generator/actions/runs/34332842605/job/102416313593?pr=24902

done

@wing328
wing328 merged commit a7678ef into OpenAPITools:master Sep 10, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants